home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_19_1987_Transactor_Publishing.d64 / directory 64.pal (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  2KB  |  78 lines

  1. 1000 rem save"0:directory 64.pal",8
  2. 1010 rem * by eric germain  ste-foy, quebec
  3. 1020 open 8,8,1,"0:directory 64.obj"
  4. 1030 sys700
  5. 1040 .opt o8
  6. 1050 *=$c000
  7. 1060 ;
  8. 1070 status = $90   ; file status variable
  9. 1080 return = $aad3 ; send chr$(13)
  10. 1090 fixflt = $b391 ; fixed-float conversion
  11. 1100 shwflt = $bdd7 ; print floating point value
  12. 1110 acptr  = $ffa5 ; input byte from serial port
  13. 1120 ciout  = $ffa8 ; output byte to serial port
  14. 1130 listen = $ffb1 ; set listen
  15. 1140 second = $ff93 ; send sa after listen
  16. 1150 talk   = $ffb4 ; set talk
  17. 1160 tksa   = $ff96 ; send sa after talk
  18. 1170 unlsn  = $ffae ; command bus to unlisten
  19. 1180 untlk  = $ffab ; command bus to untalk
  20. 1190 chrout = $ffd2 ; output character
  21. 1200 stop   = $ffe1 ; test (stop) key
  22. 1210 ;
  23. 1220 ; ** directory read demo **
  24. 1230 ;
  25. 1240 lda #8        ; device number
  26. 1250 jsr listen    ; and secondary address
  27. 1260 lda #$f0      ; 'or'ed with $f0
  28. 1270 jsr second    ; to indicate a file to be opened
  29. 1280 lda #"$"      ; "$0"
  30. 1290 jsr ciout     ; sent as filename
  31. 1300 lda #"0"      ; one character at a time
  32. 1310 jsr ciout
  33. 1320 jsr unlsn     ; stop listening
  34. 1330 lda #8        ; device number
  35. 1340 jsr talk      ; and secondary address
  36. 1350 lda #$60      ; 'or'ed with $60
  37. 1360 jsr tksa      ; to indicate normal i/o operation
  38. 1370 lda #0        ; set status word
  39. 1380 sta status    ; to zero
  40. 1390 jsr acptr     ; get two dummies
  41. 1400 jsr acptr
  42. 1410 jsr return    ; print carriage return
  43. 1420 ;
  44. 1430 main = *
  45. 1440 jsr acptr     ; get two dummies
  46. 1450 jsr acptr
  47. 1460 jsr acptr     ; line number (low/high)
  48. 1470 tay
  49. 1480 jsr acptr
  50. 1490 ldx status    ; check status
  51. 1500 bne fini      ; exit on error
  52. 1510 ;
  53. 1520 jsr fixflt    ; put line number in fpacc#1
  54. 1530 ldy #1        ; print line number
  55. 1540 jsr shwflt    ; (which is the block count)
  56. 1550 lda #32       ; print a space
  57. 1560 jsr chrout
  58. 1570 ;
  59. 1580 loop = *
  60. 1590 jsr acptr     ; get character
  61. 1600 php
  62. 1610 jsr chrout    ; print it
  63. 1620 plp
  64. 1630 bne loop      ; if non-zero then continue
  65. 1640 ;
  66. 1650 jsr return    ; print carriage return
  67. 1660 jsr stop      ; check stop key
  68. 1670 bne main
  69. 1680 ;
  70. 1690 fini = *
  71. 1700 jsr untlk     ; un-talk
  72. 1710 lda #8
  73. 1720 jsr listen
  74. 1730 lda #$e0      ; the secondary address
  75. 1740 jsr second    ; is 'or'ed with $e0
  76. 1750 jsr unlsn     ; to indicate a file to be closed
  77. 1760 rts           ; return to basic
  78.